package com.drako.tdgdx.logic;

import java.util.ArrayList;

import com.badlogic.gdx.math.Vector2;

public class Way {
	private ArrayList<Way> possibleWayPoints;
	private boolean isHitPoint;
	private static PlayField field = new PlayField(50,30);
	private int x;
	private int y;
	private int targetX;
	private int targetY;
	
	public Way(int x, int y,int targetX, int targetY,boolean isHitpoint){
		possibleWayPoints = new ArrayList<Way>();
		this.x =x;
		this.y =y;
		this.targetX = targetX;
		this.targetY =targetY;
		this.isHitPoint = isHitpoint;
		
	}
	
	public boolean generatePossibleWaypoints(){
		if(isHitPoint){
			return doSideSteps();
		}else{
			return doForwardStep();
		}
	}

	private boolean doForwardStep() {
		int tempX =x;
		for (int i = 0; i < field.field[tempX].length; i++) {
			if(i == (field.field[x].length-1)&& field.field[x][i]== true){
				i= field.field[x+1].length-1;
				tempX++;
			}else if(field.field[x][i]==false){
				Way wp = new Way(x, i-1, this.targetX, this.targetY	, true);
				
				break;
			}
		}
		return true;
		
		
	}

	private boolean doSideSteps() {
		// TODO Auto-generated method stub
		return true;
		
	}
}
